public class Board {
	static int[][] boardLocs = new int[23][12];
	public Board() {
	//setting boundaries. 8 is a flag for "NOTHING!!"
		for(int count=0; count<boardLocs.length; count++) {
			boardLocs[count][0] = 8;
		}
		for(int count=0; count<boardLocs[22].length; count++) {
			boardLocs[22][count] = 8;
		}
		for(int count=0; count<boardLocs.length; count++) {
			boardLocs[count][11] = 8;
		}
	}
	public static boolean checkSpace(int r, int c, int[][] loc){
		boolean space = true;
		rowloop: for (int rowcount = 0; rowcount < loc.length; rowcount++) {
			for (int colcount = 0; colcount < loc[rowcount].length; colcount++) {
				if (loc[rowcount][colcount] != 0
						&& boardLocs[rowcount + r][colcount + c] != 0) {
					space = false;
					break rowloop;
				}
			}
		}
		return space;
	}
	public static boolean checkSpace(int r, int c, int[][] loc, String dir) {
		boolean space = true;
		if (dir == "left") {
			rowloop: for (int rowcount = 0; rowcount < loc.length; rowcount++) {
				for (int colcount = 0; colcount < loc[rowcount].length; colcount++) {
					if (loc[rowcount][colcount] != 0
							&& boardLocs[rowcount + r][colcount + c - 1] != 0) {
						space = false;
						break rowloop;
					}
				}
			}
		}
		if (dir == "right") {
			rowloop: for (int rowcount = 0; rowcount < loc.length; rowcount++) {
				for (int colcount = 0; colcount < loc[rowcount].length; colcount++) {
					if (loc[rowcount][colcount] != 0
							&& boardLocs[rowcount + r][colcount + c + 1] != 0) {
						space = false;
						break rowloop;
					}
				}
			}
		}
		if (dir == "down") {
			rowloop: for (int rowcount = 0; rowcount < loc.length; rowcount++) {
				for (int colcount = 0; colcount < loc[rowcount].length; colcount++) {
					if (loc[rowcount][colcount] != 0
							&& boardLocs[rowcount + r + 1][colcount + c] != 0) {
						space = false;
						break rowloop;
					}
				}
			}
		}
		if (dir == "c" || dir == "cc") {
			rowloop: for (int rowcount = 0; rowcount < loc.length; rowcount++) {
				for (int colcount = 0; colcount < loc[rowcount].length; colcount++) {
					if (loc[rowcount][colcount] != 0
							&& boardLocs[rowcount + r][colcount + c] != 0) {
						space = false;
						break rowloop;
					}
				}
			}
		}
		return space;
	}
public void newShape(Shape theShape) {
	if (checkSpace(theShape.row, theShape.column, theShape.locs)){
		for(int r=0;r<theShape.locs.length; r++){
			for(int c=0;c<theShape.locs[r].length; c++){
				if(theShape.locs[r][c] != 0){
					boardLocs[theShape.row+r][theShape.column+c] = theShape.locs[r][c];
				}
			}
		}
	}		
}
	public void moveShape(int r, int c, int[][] loc, String dir) {
int[][] boardCopy = boardLocs;

	}
}
